package com.ym.medical.domain.param;

import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.base.enums.FlagEnum;
import com.ym.medical.domain.entity.StandardDeptEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 标准科室对象 standard_dept
 *
 * @author ym
 * @date 2020-08-25
 */
@ApiModel("标准科室-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StandardDeptUpdateParam extends BeanCovert<StandardDeptEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("标准科室编码")
    @Size(max = 32, message = "标准科室编码长度超过{max}", groups = {Add.class, Update.class})
    private String deptCode;

    @ApiModelProperty("科室名称")
    @Size(max = 128, message = "科室名称长度超过{max}", groups = {Add.class, Update.class})
    private String deptName;

    @ApiModelProperty("科室图标")
    @Size(max = 128, message = "科室图标长度超过{max}", groups = {Add.class, Update.class})
    private String deptImgUrl;

    @ApiModelProperty("父级科室编码")
    @Size(max = 20, message = "父级科室编码长度超过{max}", groups = {Add.class, Update.class})
    private String partentDeptCode;

    @ApiModelProperty("科室级别")
    private Integer deptLevel;

    @ApiModelProperty("科室排序")
    private Integer deptSort;

    @ApiModelProperty("状态")
    @NotEmpty(message = "状态不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "状态长度超过{max}", groups = {Add.class, Update.class})
    private String state;

    @ApiModelProperty("创建时间")
    @NotNull(message = "创建时间不能为空", groups = Add.class)
    private Date createTime;

    @ApiModelProperty("修改时间")
    @NotNull(message = "修改时间不能为空", groups = {Add.class, Update.class})
    private Date updateTime;

    @ApiModelProperty("删除标志")
    @NotEmpty(message = "删除标志不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "删除标志长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(FlagEnum.class)
    private String deleted;

}
